#include "myi2c.h"   // 包含自定义的I2C初始化函数
#include "driver/i2c.h"   // 包含I2C驱动程序的头文件

/**
 * @brief GXHTC3 读取 TAH 错误。
 */
esp_err_t i2c_master_init(void) //i2c初始化
{
    int i2c_master_port = I2C主端口;

    i2c_config_t conf = {
        .mode = I2C_MODE_MASTER,
        .sda_io_num = I2C主数据,
        .scl_io_num = I2C主时钟,
        .sda_pullup_en = GPIO_PULLUP_ENABLE,
        .scl_pullup_en = GPIO_PULLUP_ENABLE,
        .master.clk_speed = I2C主频率,
    };

    i2c_param_config(i2c_master_port, &conf); //配置

    return i2c_driver_install(i2c_master_port, conf.mode, I2C接收缓冲区, I2C发送缓冲区, 0); //安装
}